import React from 'react';
import {NavLink} from "react-router-dom";
import './index.less'
import PubSub from 'pubsub-js'
export default function HeadLead(){
    return (
        <ul className='headLead'>
            <li><NavLink activeClassName='headActive' to='/mall/home'>首页</NavLink></li>
            <li><NavLink activeClassName='headActive' to='/mall/apple' onMouseEnter={sendSname}>苹果</NavLink></li>
            <li><NavLink activeClassName='headActive' to='/mall/huawei'  onMouseEnter={sendSname}>华为</NavLink></li>
            <li><NavLink activeClassName='headActive' to='/mall/mi' onMouseEnter={sendSname}>小米</NavLink></li>
            <li><NavLink activeClassName='headActive' to='/mall/parts' onMouseEnter={sendSname}>配件</NavLink></li>
        </ul>
    )
    function sendSname(e){
        PubSub.publish('geiSideName', e.target.innerHTML);
    }
}